package com.sparrow.source.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sparrow.source.common.dto.AccountQueryDTO;
import com.sparrow.source.common.dto.PassWordUpdate;
import com.sparrow.source.common.dto.RegistryDTO;
import com.sparrow.source.common.dto.Result;
import com.sparrow.source.persistense.IasAccount;

import javax.servlet.http.HttpServletRequest;

/**
 * @author bryceyung
 * @since 2024/12/5
 */
public interface IasAccountService extends IService<IasAccount> {

    /**
     * 用户登陆
     *
     * @param userName
     * @param password
     * @return
     */
    Result login(String userName, String password);

    /**
     * 用户账号注册
     *
     * @param account
     * @param request
     * @return
     */
    Result registry(RegistryDTO account, HttpServletRequest request);

    /**
     * 密码修改
     *
     * @param passWordUpdate
     * @return
     */
    Result passwordUpdate(PassWordUpdate passWordUpdate, HttpServletRequest request);

    /**
     * 退出登陆
     *
     * @param accountId
     * @param request
     * @return
     */
    Result logout(Integer accountId, HttpServletRequest request);

    /**
     * 校验用户名
     *
     * @param userName
     * @return
     */
    Result checkUserName(String userName);

    /**
     * 分页查询用户信息
     *
     * @param accountPage
     * @param accountQueryDTO
     * @return
     */
    Result queryAccount(Page<IasAccount> accountPage, AccountQueryDTO accountQueryDTO);

    Result deleteAccount(Integer accountId);

    Result updateStatusOrType(Integer accountId, Integer status, Integer type);

}
